package com.net.oil.coupon.adapter;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;

import com.net.oil.coupon.fragment.CouponListFragment;

/**
 * 作者：lch
 * 时间：2018/4/29 0029:下午 17:01
 * 邮箱：245850413@qq.com
 * 说明：
 */

public class CouponViewPagerAdapter extends FragmentStatePagerAdapter {

    private String[] tabName;

    public CouponViewPagerAdapter(FragmentManager fm, String[] tabName) {
        super(fm);
        this.tabName = tabName;
    }

    @Override
    public Fragment getItem(int position) {
        return CouponListFragment.getInstance(position);
    }

    @Override
    public int getCount() {
        return tabName.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return tabName[position];
    }
}
